import { createDiscreteApi } from "naive-ui"

const { message, notification, dialog, loadingBar, modal } = createDiscreteApi(
    ["message", "dialog", "notification", "loadingBar", "modal"],
    {}
)

export function useCommonLoadingBar() {
    return {
        start: loadingBar.start,
        finish: loadingBar.finish,
        error: loadingBar.error
    }
}

export function useCommonMessage() {
    return {
        info: message.info,
        success: message.success,
        warning: message.warning,
        error: message.error
    }
}

export function useCommonNotification() {
    return {
        info: notification.info,
        success: notification.success,
        warning: notification.warning,
        error: notification.error
    }
}
